/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package spatialmarketplace.cem.dao;

import java.util.ArrayList;
import spatialmarketplace.cem.model.ForumPost;

/**
 * Provides the interface for the Forum Post from the Database
 * @author Camila
 */
public interface ForumPostDao {
    /**
     * Reads a group forum from the database provided its id.
     * @param groupId
     * @return 
     */
    public ArrayList<ForumPost> readGroupForum(Integer groupId);
    
    /**
     * Reads a group resource from the database provided its id.
     * @param resourceId
     * @return 
     */
    public ArrayList<ForumPost> readResourceForum(Integer resourceId);
    
    /**
     * Saves a new Forum Post to the database
     * @param post
     * @param belongsToGroup indicates if the forum post belongs to a group or a resource
     * @return id of the recently inserted forum post.
     */
    public Integer postToForum(ForumPost post, boolean belongsToGroup);
    
    /**
     * Updates all the information of a forum post.
     * @param post 
     */
    public void updatePost(ForumPost post);
    
    /**
     * Increases the likes count of a forum post and relates it to a user.
     * @param postId 
     */
    public void likePost(Integer postId);
    
    /**
     * Reports a post.
     * @param postId 
     */
    public void reportPost(Integer postId);
}
